package com.sc.VenusQueryBeta.model.account.daikuan;

import com.hengjun.kingstar.sdk.base.BaseModel;
import com.hengjun.kingstar.sdk.helper.RetrofitCreateHelper;
import com.hengjun.kingstar.sdk.helper.RxHelper;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.api.account.AccountApi;
import com.sc.VenusQueryBeta.contract.account.daikuan.DaiKuan01Contract;
import com.sc.VenusQueryBeta.model.bean.account.CurrencyListBean;
import com.sc.VenusQueryBeta.model.bean.account.daikuan.DaiKuanBean01;

import io.reactivex.Observable;


/**
 * Created by Administrator on 2018/10/18.
 */

public class DaiKuanModel01 extends BaseModel implements DaiKuan01Contract.IDaiKuan01Model {

    public static DaiKuanModel01 newInstance() {
        return new DaiKuanModel01();
    }

//    数据模型
    @Override
    public Observable<DaiKuanBean01> getDaiKuan01(String serverAddress, String projectName, int serverPort, int clientindex, int start, int limit, String clientAppmsgnum,String currencynameCN) {
        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base+serverAddress+":"+serverPort+"/"+projectName+"/").
                daikuan1(clientindex,start,limit,clientAppmsgnum,currencynameCN).compose(RxHelper.<DaiKuanBean01>rxSchedulerHelper());
    }

    @Override
    public Observable<CurrencyListBean> queryAllCurrencyList(String serverAddress, String projectName, int serverPort) {
        return RetrofitCreateHelper.createApi(AccountApi.class, Host.base + serverAddress + ":" + serverPort + "/" + projectName + "/").queryCurrencyList().compose(RxHelper.<CurrencyListBean>rxSchedulerHelper());
    }
}
